/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package tc.maas.eikotrade.domain.faces;

import java.util.logging.Level;
import org.apache.log4j.Logger;
import tc.maas.eikotrade.dataaccess.DataManager;

/**
 *
 * @author michel
 */
public class TestFace {
    
    private static final Logger LOG = Logger.getLogger(TestFace.class);
    
    public static boolean store(Object objectToStore){
        try{
            String stringToStore = (String)objectToStore;
            DataManager dataManager = new DataManager();
            dataManager.store(stringToStore);
        }catch(ClassCastException e){
            LOG.error(objectToStore,e);
            return false;
        }
        return true;
    }
    
    public static Comparable find(Comparable value){
        try {
            DataManager dataManager = new DataManager();        
            Comparable comparable = dataManager.findComparable(value.getClass(), null);
            return comparable;
        } catch (Exception ex) {
            LOG.error(value,ex);
            return null;
        }        
    }
    
}
